#ifndef JOBLOG_H
#define JOBLOG_H

#include "BaseEntity.h"


class JobLog : public BaseEntity{
public:
    qlonglong jobLogId;
    QString jobName;
    QString jobGroup;
    QString invokeTarget;
    QString jobMessage;
    QString status;
    QString exceptionInfo;
    QString startTime;
    QString stopTime;

    QJsonObject toJson() const {
        QJsonObject jsonObj;
        jsonObj["jobLogId"] = QString::number(jobLogId);
        jsonObj["jobName"] = jobName;
        jsonObj["jobGroup"] = jobGroup;
        jsonObj["invokeTarget"] = invokeTarget;
        jsonObj["jobMessage"] = jobMessage;
        jsonObj["status"] = status;
        jsonObj["exceptionInfo"] = exceptionInfo;
        jsonObj["startTime"] = startTime;
        jsonObj["stopTime"] = stopTime;
        jsonObj["searchValue"] = searchValue;
        jsonObj["createBy"] = createBy;
        jsonObj["createTime"] = createTime;
        jsonObj["updateBy"] = updateBy;
        jsonObj["updateTime"] = updateTime;
        jsonObj["remark"] = remark;

        return jsonObj;
    }

    static JobLog toJobLog(const QJsonObject& json) {
        JobLog jobLog;
        jobLog.jobLogId = json["jobLogId"].toInt();
        jobLog.jobName = json["jobName"].toString();
        jobLog.jobGroup = json["jobGroup"].toString();
        jobLog.invokeTarget = json["invokeTarget"].toString();
        jobLog.jobMessage = json["jobMessage"].toString();
        jobLog.status = json["status"].toString();
        jobLog.exceptionInfo = json["exceptionInfo"].toString();
        jobLog.startTime = json["startTime"].toString();
        jobLog.stopTime = json["stopTime"].toString();
        jobLog.searchValue = json["searchValue"].toString();
        jobLog.createBy = json["createBy"].toString();
        jobLog.createTime = json["createTime"].toString();
        jobLog.updateBy = json["updateBy"].toString();
        jobLog.updateTime = json["updateTime"].toString();
        jobLog.remark = json["remark"].toString();

        return jobLog;
    }
};

#endif // JOBLOG_H
